<?php
$poolsList = array();
$eventId = $parentEventId;
if ($eventId > 0) {
    $event = new BWEvent($eventId);
    $poolsList = $event->getMessageManager()->getMessageList();
}
?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    "id" => "brand-form",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('enctype' => 'multipart/form-data'),
        ));
?>
<div class="modal-body" id="Event_shop_add">
    <div><legend style="margin-bottom: 0px;">
            <?php
            echo $control->getAjaxLink(array('name' => '活动列表', 'id' => 'showEventList'), array(
                'cooker' => 'managePools\showPoolsList',
                'htmlOptions' => array('enctype' => 'multipart/form-data')));
            ?> &gt; 
            <?php
            echo $control->getAjaxLink(array('name' => $event->name . '投票列表', 'id' => 'showMessageList'), array('parentEventId' => $eventId,
                'messageListView' => 'poolsList',
                'htmlOptions' => array('enctype' => 'multipart/form-data')));
            ?>
        </legend>
    </div>
    <fieldset>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>
                        <input type="checkbox" id="ShopCheckAll"> 
                    </th>
                    <th>投票名称</th>

                    <th>行动</th>
                </tr> 
            </thead>
            <tbody>
                <?php foreach ($poolsList as $pools) { ?>
                    <tr>
                        <td><label class="checkbox">
                                <input type="checkbox" name="subBox[]" value="1"> 
                            </label></td>
                        <td> <?php
                            echo $pools->name;
                            ?>  </td>
                        <td>
                            <a href="#myModal<?php echo $pools->id; ?>" role="button" data-toggle="modal">修改</a>
                            &nbsp;|&nbsp;

                            <?php
                            $modalPage = new BUIControl();
                            $modalPage->addRenderView('modalPage', 'addPools', array('poolsId' => $pools->id, 'eventId' => $eventId, 'form' => $form));
                            $modalPage->render();
                            ?>
                        </td>
                    </tr>

                <?php } ?>             
            </tbody>
        </table>

        <div class="row-fluid">
            <a href="#myModal0" role="button" data-toggle="modal" class="btn">添加投票</a>
            <?php //echo $control->getAjaxLink(array('name' => '添加品牌', 'id' => 'addMessage1'), array('htmlOptions' => array('enctype' => 'multipart/form-data', 'class' => 'btn')));  ?>
            <a href="#" role="button" data-toggle="modal" class="btn">删除投票</a>
        </div>
        <?php
        $modalPage = new BUIControl();
        $modalPage->addRenderView('modalPage', 'addPools', array('poolsId' => 0, 'eventId' => $eventId, 'form' => $form));
        $modalPage->render();
        ?>
    </fieldset>
</div> 
<?php $this->endWidget(); ?>